package msu.ml.core.xml;

import msu.ml.core.*;
import msu.ml.data.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;

/**
 * @author Reginald M Mead
 * @version 1.0
 */
public class AttributeRemovalPreProcessorParser implements IPreProcessorParser
{
	public IDataPreProcessor parse(Element element)
   {
      AttributeRemovalPreProcessor processor = 
         new AttributeRemovalPreProcessor();

      boolean invert = Boolean.parseBoolean(element.getAttribute("invert"));
      String indices = element.getAttribute("indices");
      processor.setInvertSelection(invert);
      processor.setAttributeIndices(indices);

		if(ApplicationSettings.getInstance().getConfig("verbose").equals("true"))
		{
			System.out.println("Attribute Removal Pre Processor");
			System.out.println("\t Remove Attributes " + indices);
			System.out.println("\t Invert Attributes = " + invert);
		}

      return processor;
   }
}
